package top.fzqblog.customview;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ScrollView;

/**
 * Created by 抽离 on 2017/10/14 0014.
 */

public class MyScrollView extends ScrollView {

    private OnMyScrollChangedListener onMyScrollChangedListener;

    public MyScrollView(Context context) {
        super(context);
    }

    public MyScrollView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public MyScrollView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }




    public void setOnMyScrollChangedListener(OnMyScrollChangedListener onMyScrollChangedListener){
        this.onMyScrollChangedListener = onMyScrollChangedListener;
    }

    @Override
    protected void onScrollChanged(int x, int y, int oldx, int oldy) {
        super.onScrollChanged(x, y, oldx, oldy);
        onMyScrollChangedListener.onScrollChanged(this, x, y, oldx, oldy);
    }
}
